// pages/index/swiper/index.js
const app = getApp();
Page({

    /**
     * 页面的初始数据
     */
    data: {
        img: [],
        headTop: "",
        headHeight: "",
        sumHeight: "",
        index: 1,
        swiperH: ""
    },

    /**
     * 生命周期函数--监听页面加载
     */
    onLoad(options) {
        const that = this
        navigationBarRightButton: {
            hide: true
        }
        let img = JSON.parse(options.img)
        that.setData({
            img,
            headTop: app.globalData.headTop,
            headHeight: app.globalData.headHeight,
            sumHeight: app.globalData.sumHeight,
        });
        console.log(decodeURIComponent(options.img))
    },
    break () {
        wx.navigateBack({
            delta: 1,
        })
    },
    change(e) {
        let index = e.detail.current + 1
        this.setData({
            index
        })
    },
    computerImg(e) {
        let winW = wx.getSystemInfoSync().windowWidth
        let imgh = e.detail.height
        let imgw = e.detail.width
        let swiperH = winW * imgh / imgw + 'px'
        this.setData({
            swiperH
        })
    },


    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide() {

    },

    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload() {

    },

    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh() {

    },

    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom() {

    },

    /**
     * 用户点击右上角分享
     */
    onShareAppMessage() {

    }
})